using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;

namespace KPIS.GERP.Models.BGM
{
	[Table("bgm_project_operation_report"), DataContract]
    public class ProjectOperationReport
    {

		[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
		[DataMember, Display(Name = "ProjOperRptId", ResourceType = typeof(Resources.ProjectOperationReportResource))]
		[Column("bgm_proj_oper_rpt_seq", TypeName="int")]
        public int ProjOperRptId { get; set; }

		[DataMember, Display(Name = "Descr", ResourceType = typeof(Resources.ProjectOperationReportResource))]
        [Column("descr", TypeName="ntext")]
        public string Descr { get; set; }

        [ForeignKey("ProjectOperationExpense")]
		[DataMember, Display(Name = "ProjOperExpId", ResourceType = typeof(Resources.ProjectOperationReportResource))]
        [Column("bgm_proj_oper_exp_seq", TypeName="int")]
        public int? ProjOperExpId { get; set; }

        //[ForeignKey("TransFrom")]
        //[DataMember, Display(Name = "TransFromId", ResourceType = typeof(Resources.ProjectOperationReportResource))]
        //[Column("bgm_trans_from_seq")]
        //public int? TransFromId { get; set; }

        //[ForeignKey("BgmTransTo")]
        //[DataMember, Display(Name = "TransToId", ResourceType = typeof(Resources.ProjectOperationReportResource))]
        //[Column("bgm_trans_to_seq")]
        //public int? TransToId { get; set; }

        //[ForeignKey("BgmBooking")]
        //[DataMember, Display(Name = "BgmBookingId", ResourceType = typeof(Resources.ProjectOperationReportResource))]
        //[Column("bgm_booking_seq")]
        //public int? BgmBookingId { get; set; }

        [ForeignKey("PrePurchaseRequestItem")]
		[DataMember, Display(Name = "PprItemId", ResourceType = typeof(Resources.ProjectOperationReportResource))]
        [Column("icm_ppr_item_seq", TypeName="int")]
        public int? PprItemId { get; set; }

        [ForeignKey("PurchaseRequestItem")]
		[DataMember, Display(Name = "PrItemId", ResourceType = typeof(Resources.ProjectOperationReportResource))]
        [Column("icm_pr_item_seq", TypeName="int")]
        public int? PrItemId { get; set; }

        [ForeignKey("PurchaseOrderInstallmentItem")]
		[DataMember, Display(Name = "PoInstallItemId", ResourceType = typeof(Resources.ProjectOperationReportResource))]
        [Column("icm_po_install_item_seq", TypeName="int")]
        public int? PoInstallItemId { get; set; }

        [ForeignKey("DeliveryNoteItem")]
		[DataMember, Display(Name = "DnItemId", ResourceType = typeof(Resources.ProjectOperationReportResource))]
        [Column("icm_dn_item_seq", TypeName="int")]
        public int? DnItemId { get; set; }

        [ForeignKey("PayRequestDtl")]
        [DataMember, Display(Name = "MoneyReqDtlsId", ResourceType = typeof(Resources.ProjectOperationReportResource))]
        [Column("money_req_dtls_seq", TypeName="int")]
        public int? MoneyReqDtlsId { get; set; }

        [ForeignKey("ReturnDtl")]
        [DataMember, Display(Name = "ReturnDtlsId", ResourceType = typeof(Resources.ProjectOperationReportResource))]
        [Column("return_dtls_seq", TypeName="int")]
        public int? ReturnDtlsId { get; set; }

        [ForeignKey("PetitionDtl")]
        [DataMember, Display(Name = "PetitionDtlsId", ResourceType = typeof(Resources.ProjectOperationReportResource))]
        [Column("petition_dtls_seq", TypeName="int")]
        public int? PetitionDtlsId { get; set; }

        [ForeignKey("Pay")]
        [DataMember, Display(Name = "PayId", ResourceType = typeof(Resources.ProjectOperationReportResource))]
        [Column("pay_seq", TypeName="int")]
        public int? PayId { get; set; }

		[DataMember, Display(Name = "UsedAmount", ResourceType = typeof(Resources.ProjectOperationReportResource))]
		[Column("used_amount", TypeName="decimal")]
        public decimal? UsedAmount { get; set; }

		[DataMember, Display(Name = "CalAmount", ResourceType = typeof(Resources.ProjectOperationReportResource))]
		[Column("cal_amount", TypeName="decimal")]
        public decimal? CalAmount { get; set; }

		[DataMember, Display(Name = "RptType", ResourceType = typeof(Resources.ProjectOperationReportResource))]
		[Column("rpt_type", TypeName="int")]
        public int? RptType { get; set; }

        [DataMember]
        public virtual ProjectOperationExpense ProjectOperationExpense { get; set; }

        //[DataMember]
        //public virtual TransferFrom BgmTransFrom { get; set; }

        //[DataMember]
        //public virtual BGM.TransferFrom BgmTransTo { get; set; }

        //[DataMember]
        //public virtual Booking BgmBooking { get; set; }

        [DataMember]
        public virtual ICM.PrePurchaseRequestItem PrePurchaseRequestItem { get; set; }

        [DataMember]
        public virtual ICM.PurchaseRequestItem PurchaseRequestItem { get; set; }

        [DataMember]
        public virtual ICM.PurchaseOrderInstallmentItem PurchaseOrderInstallmentItem { get; set; }

        [DataMember]
        public virtual ICM.DeliveryNoteItem DeliveryNoteItem { get; set; }

        [DataMember]
        public virtual FIM.PayRequestDtl PayRequestDtl { get; set; }

        [DataMember]
        public virtual FIM.ReturnDtl ReturnDtl { get; set; }

        [DataMember]
        public virtual FIM.PetitionDtl PetitionDtl { get; set; }

        [DataMember]
        public virtual FIM.Pay Pay { get; set; }



        #region RecordStatus

        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("record_status", TypeName="ntext")]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("created_by", TypeName="int")]
        public Nullable<int> CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("created_when", TypeName="datetime2")]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("updated_by", TypeName="int")]
        public Nullable<int> UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("updated_when", TypeName="datetime2")]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

        #endregion

    }
}